<extend name="Public/layout"/>

<block name="body">
    <div class="title">
        <h2>{$meta_title}</h2>
    </div>
    <div class="row toolbar">
        <div class="col-xs-12">
            <a class="btn" href="{:U('add')}">新 增</a>
            <a class="btn ajax-post confirm" target-form="ids" href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'resume'))}">启 用</a>
            <a class="btn ajax-post confirm" target-form="ids" href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'forbid'))}">禁 用</a>
            <a class="btn ajax-post confirm" target-form="ids" href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'delete'))}">删 除</a>
        </div>
    </div>
    <div class="data-table">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th><input class="check-all" type="checkbox"></th>
                    <th>ID</th>
                    <th>标题</th>
                    <th class="hidden-xs">链接</th>
                    <th class="hidden-xs">图标</th>
                    <th class="hidden-xs">排序</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="volist" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td class="hidden-xs">{$vo.id}</td>
                        <td>{$vo.title_show}</td>
                        <td class="hidden-xs">{$vo.url}</td>
                        <td><i class="{$vo.icon}"></i></td>
                        <td class="hidden-xs">{$vo.sort}</td>
                        <td>{$vo.status_text}</td>
                        <td>
                            <a href="{:U('edit', array('id' => $vo['id']))}" data-toggle="tooltip" title="编辑该菜单">编辑</a>
                            <eq name="vo.status" value="1">
                                <a href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'forbid', 'ids' => $vo['id']))}" class="ajax-get confirm" data-toggle="tooltip" title="标记为禁用状态">禁用</a>
                            <else />
                                <a href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'resume', 'ids' => $vo['id']))}" class="ajax-get confirm" data-toggle="tooltip" title="标记为启用状态">启用</a>
                            </eq>
                            <a href="{:U(CONTROLLER_NAME.'/setStatus',array('status'=>'delete', 'ids' => $vo['id']))}" class="ajax-get confirm" data-toggle="tooltip" title="标记为删除状态">删除</a>
                        </td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
</block>
